﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Globalization;
using GuildStock.Models;

namespace GuildStock.Services.Blizzard
{
  /// <summary>
  /// Blizzard service.
  /// </summary>
  public partial class BlizzardService : IBlizzardService
  {
    /// <summary>
    /// Get guild members request uri.
    /// </summary>
    private static string GuildMembers = @"/api/wow/guild/{0}/{1}?fields=members";

    /// <summary>
    /// Gets guild members.
    /// </summary>
    public string GetGuildMembers(string guild, string realm, Zones zone)
    {
      var guildMembersRequest = string.Format(
        CultureInfo.InvariantCulture, 
        GuildMembers, 
        HttpUtility.HtmlEncode(realm), 
        HttpUtility.HtmlEncode(guild));

      return this.GetResponseString(zone, guildMembersRequest);
    }
  }
}